<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ include file="../common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript">
	$(document).ready(function(){
		$("#uploadNewDocForm").attr("action",'<c:out value="${flowExecutionUrl}"></c:out>');
		});
</script>
<table>

<c:forEach items="${docAttributesList}" var="docAttribute" varStatus="status" step="2">
	<tr>
		<td>
			<label>${docAttributesList[status.index].dmaName}</label>
		</td>
		<td class="spacingColumn"></td>
		<td>
			<c:choose>
				<c:when test="${docAttribute.dmaLength gt 200}">
					<form:textarea path="docDetailsForm.metaDataAttrList[${status.index}].metaDataAttrValue" cssClass="text ui-widget-content ui-corner-all" cols="20" rows="${docAttribute.dmaLength/1000}"/>
				</c:when>
				<c:otherwise>
					<form:input path="docDetailsForm.metaDataAttrList[${status.index}].metaDataAttrValue" cssClass="text ui-widget-content ui-corner-all"/>
				</c:otherwise>
			</c:choose>
			<form:hidden path="docDetailsForm.metaDataAttrList[${status.index}].metaDataAttrId" value="${docAttributesList[status.index].dmaId}"/>
		</td>
	<c:if test="${(status.index + 1) lt fn:length(docAttributesList)}">
		<td class="spacingColumn"></td>
		<td>
			<label>${docAttributesList[status.index + 1].dmaName}</label>
		</td>
		<td class="spacingColumn"></td>
		<td>
			<c:choose>
				<c:when test="${docAttribute.dmaLength gt 200}">
					<form:textarea path="docDetailsForm.metaDataAttrList[${status.index + 1}].metaDataAttrValue" cssClass="text ui-widget-content ui-corner-all" cols="20" rows="${docAttribute.dmaLength/1000}"/>
				</c:when>
				<c:otherwise>
					<form:input path="docDetailsForm.metaDataAttrList[${status.index + 1}].metaDataAttrValue" cssClass="text ui-widget-content ui-corner-all"/>
				</c:otherwise>
			</c:choose>
			<form:hidden path="docDetailsForm.metaDataAttrList[${status.index + 1}].metaDataAttrId" value="${docAttributesList[status.index + 1].dmaId}"/>
		</td>
	
	</c:if>	
	</tr>
	<tr>
		<td></td>
		<td class="spacingColumn"></td>
		<td>
			<form:errors path="docDetailsForm.metaDataAttrList[${status.index}].metaDataAttrValue" cssClass="text errorMsg"></form:errors>
		</td>
	<c:if test="${(status.index + 1) lt fn:length(docAttributesList)}">
		<td class="spacingColumn"></td>
		<td></td>
		<td class="spacingColumn"></td>
		<td>
			<form:errors  path="docDetailsForm.metaDataAttrList[${status.index + 1}].metaDataAttrValue" cssClass="text errorMsg"></form:errors>
		</td>
	</c:if>	
	</tr>
	<tr class="spacingRow"><td></td> </tr>
</c:forEach>
</table>
